package com.weishuang.account.service.impl;


import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.weishuang.account.entity.Permission;
import com.weishuang.account.mapper.PermissionMapper;
import com.weishuang.account.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements PermissionService {

    @Autowired
    private PermissionMapper permissionMapper;

    @Override
    public List<Permission> getByIds(Set<String> roleIds) {
        if(CollectionUtils.isEmpty(roleIds)){
            return new ArrayList<>();
        }
        return permissionMapper.selectBatchIds(roleIds);
    }
}
